function [AF2, Am3] = interpAz_R(F2, Fm3, Az_R)
%
% Interpolation of ITU-R Coefficients for Az_R
%
%DESCRIPTION:
%This function computes AF2, the array of interpolated coefficients for
%foF2 and Am3, the array of interpolated coefficients for M(3000)F2.
%
%PROTOTYPE:
% [AF2, Am3] = interpAz_R(F2, Fm3, Az_R)
%
%--------------------------------------------------------------------------
% INPUTS:
%   F2         [2x76x13]   Coeff.s for foF2          [-]
%   Fm3        [2x49x9]    Coeff.s for M(3000)F2     [-]
%   Az_R       [1x1]       Eff. Sun Spot Numb.       [-]
%--------------------------------------------------------------------------
% OUTPUTS:
%   AF2        [76x13]     Interp. Coeff.s for foF2  [-]
%   Am3        [49x9]      Int. Coef.s for M(3000)F2 [-]
%--------------------------------------------------------------------------
%
%NOTES:
% (none)
%
%CALLED FUNCTIONS:
% (none)
%
%UPDATES:
% (none)
%
%REFERENCES:
% [1] "Ionospheric Correction Algorithm for Galileo Single-Frequency Users"
%      - European GNSS (Galileo) Open Service
% [2] "Electron Density Models and Data for Transionospheric Radio
%      Propagation" - Report ITU-R P.2297-1 (05/2019)
%
%AUTHOR(s):
%Luigi De Maria, Matteo D'Addazio, 2022
%

%% Main Code

%Array of Interpolated Coefficients for foF2
AF2 = zeros(76,13);
for j = 1 : 76
    for k = 1 : 13
        AF2(j,k) = F2(1,j,k)*(1-Az_R/100) + F2(2,j,k)*(Az_R/100);
    end
end

%Array of Interpolated Coefficients for M(3000)F2
Am3 = zeros(49,9);
for j = 1 : 49
    for k = 1 : 9
        Am3(j,k) = Fm3(1,j,k)*(1-Az_R/100) + Fm3(2,j,k)*(Az_R/100);
    end
end

end